﻿var Professional=0;
var Knowledgeable=0;
var Helpful=0;
var SToTDesc="";
function btnsave()
{
Professional=0;
Knowledgeable=0;
Helpful=0;
SToTDesc=$('txtCommInput').value;
$('StxtCommInput').style.display="none";
$('SProfessional').style.display="none";
$('SKnowledgeable').style.display="none";
$('SHelpful').style.display="none";
$('Spasspy').style.display="none";
var passpy=$('passpy').value;
for (var i=1;i<=5;i++)
{
     if($('rdprf'+i).checked)
     {
        Professional=$('rdprf'+i).value;
     }
     if($('rdkgl'+i).checked)
     {
        Knowledgeable=$('rdkgl'+i).value;
     }
     if($('rdhf'+i).checked)
     {
        Helpful=$('rdhf'+i).value;
     }
} 
 if(Professional==0||Knowledgeable==0||Helpful==0||SToTDesc.length>999||!(passpy.length<16&&passpy.length>5))
 {
 if(SToTDesc.length>999){$('StxtCommInput').style.display="";}
 if(Professional==0){$('SProfessional').style.display="";}
 if(Knowledgeable==0){$('SKnowledgeable').style.display="";}
 if(Helpful==0){$('SHelpful').style.display="";}
 if(!(passpy.length>5&&passpy.length<16))
 {
 $('Spasspy').style.display="";
 }
 return;
 }
showProgressBar(true);
$get("btnCommInput").disabled=true;
 WebServices.User.Teach.GetPassMd5(passpy,onners);
}
function onners(re)
{  
if(re!="")
{
    $("d").value='F';
    $("s").value=sid;
    $("mp").value=Professional;
    $("mk").value=Knowledgeable;
    $("mh").value=Helpful;
    $("msg").value=SToTDesc;
    $("tno").value=tno;
    $("w").value=re;
    $("Form1").action =Session_py;
    $("Form1").submit();
}
else
{
 showProgressBar(false);
 $get("btnCommInput").disabled=false;
}
}